interface BottomNavProps {
  pathname: string
}
export default class BottomNav extends Component<BottomNavProps>{
  render() {
    const { pathname } = props
      < TagBar tintColor = 'red' >
      {
        menu.map(({ title, link, icon }) => (
          <TagBar.Item>
            key={link}
      title={title}
      icon={<span className={"iconfont icon-" + icon}></span>}
      selectedIcon={<span className={'red iconfont icon-' + icon}></span>}
      selected={pathname === link}
      onPress=
            {() => {
              history.pushState(link);
            }}
          </TagBar.Item>
        ))
      }
</TagBar >
  }
}
const { pathname } = props
  < TagBar tintColor = 'red' >
  {
    menu.map(({ title, link, icon }) => (
      <TagBar.Item>
        key={link}
      title={title}
      icon={<span className={"iconfont icon-" + icon}></span>}
      selectedIcon={<span className={'red iconfont icon-' + icon}></span>}
      selected={pathname === link}
      onPress=
        {() => {
          history.pushState(link);
        }}
      </TagBar.Item>
    ))
  }
</TagBar >

import { Location } from 'umi'
import styles from './BasicLayout.less'
interface BasicLayoutProps {
  location: Location
}
const BasicLayout: React.FC<BasicLayoutProps> = props => {
  const { children, location } = props // location传给子组件去比对
  const { pathname } = location
  return (
    <div className={styles.main}>
      <artical>{children}</artical>
      <footer>
        <BottomNav pathname={pathname}></BottomNav>

      </footer>
    </div>)
}